﻿using System;

namespace WmsApp.WindowControl.PriceAndAmount
{
    public class PriceAndAmountArithTax : PriceAndAmountArithBase
    {
        public PriceAndAmountArithTax(decimal taxRate, decimal price, decimal quantity)
            : base(taxRate, price, quantity)
        {
            
        }

        private decimal priceNotTax = 0;
        protected override void Compute()
        {
            this.PriceTax = Price;
            priceNotTax = this.PriceTax / (1 + TaxRate);
            //this.PriceNotTax = this.PriceTax/(1 + TaxRate);
            this.PriceNotTax = Math.Round(this.priceNotTax, 4);
            AmountTax = this.PriceTax*Quantity;
            AmountNotTax = Math.Round(this.priceNotTax * Quantity, 2);
        }
    }
}